﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="原材料复检判定单_Search.aspx.cs" Inherits="syc.Inspection.原材料复检判定单_Search" %>
<html>
<head runat="server">
    <title>原材料复检判定单</title>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jquery.checkbox.min.js"></script>
<script src="clearbox.js" type="text/javascript"></script>
   
</head>
<body onload="load()">
    <script type="text/javascript" language="javascript" src="/common.js"></script>
     <form id="form2" runat="server">
     <asp:ScriptManager ID="ScriptManager1" runat="server">
     </asp:ScriptManager>
    <div id="wintop" class="wintop">原料复检判定管理</div>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
    <asp:Panel ID="Panel2" runat="server" CssClass="panel" GroupingText="查 询">
        供货单位：<asp:DropDownList ID="GongHuoDanWei" runat="server" 
            DataSourceID="SqlDataSource2" DataTextField="名称" DataValueField="ID" 
            Width="100px">
        </asp:DropDownList>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 原 材 料：<asp:DropDownList 
            ID="YuanCaiLiao" runat="server" 
            DataSourceID="SqlDataSource3" DataTextField="品名" DataValueField="ID" 
            Width="210px">
        </asp:DropDownList>
         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
          <input type="button" class="smallbutton" id="clear" value="清空日期"/>        
        <br />
        开始日期：<asp:TextBox ID="Date1" runat="server" CssClass="intxt1" Width="120px"></asp:TextBox><img alt="" src="/Icons/29.png" align="middle" onclick="makecalendar(document.getElementById('Date1').value, document.getElementById('Date1'));" />
        结束日期：<asp:TextBox ID="Date2" runat="server" CssClass="intxt1" Width="120px"></asp:TextBox><img alt="" src="/Icons/29.png" align="middle" onclick="makecalendar(document.getElementById('Date2').value, document.getElementById('Date2'));" />
        <asp:Button ID="Button_Query" runat="server" CssClass="wsbutton" 
            onclick="Button_Query_Click" Text="筛选" UseSubmitBehavior="true" />
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
            ConnectionString="<%$ ConnectionStrings:SCMConnectionString1 %>" 
            SelectCommand="SELECT 0 as [ID], '全部' as [名称] union SELECT [ID], [名称] FROM [原料供货单位]">
        </asp:SqlDataSource>        
    </asp:Panel>
    <asp:SqlDataSource ID="SqlDataSource3" runat="server" 
            ConnectionString="<%$ ConnectionStrings:SCMConnectionString1 %>" 
            SelectCommand="SELECT [ID], [品名]+'('+[钢级]+')' AS [品名] FROM [原料]">
        </asp:SqlDataSource>
    <asp:Panel ID="Panel3" runat="server" CssClass="panel2">
        <asp:Label ID="Message" runat="server" Text="·准备就绪" CssClass="prompt"></asp:Label>
    </asp:Panel>
    <div class="gridframe">
        <div class="gridview">
        
            <table border="1" width="100%" cellspacing="0" cellpadding="0" bordercolor="#e5cfab">
	            <tr>
		            <td class="grid-title">复检判定管理</td>
		        </tr>
		        <tr>
		            <td class="grid-back">
                        <asp:SqlDataSource  ID="SqlDataSource1" runat="server" 
                            ConnectionString="<%$ ConnectionStrings:SCMConnectionString1 %>" 
                            SelectCommand=""
                            DeleteCommand="Delete [原料到发明细] where ID=@ID"
                            >
                            <DeleteParameters>
                                <asp:Parameter Name="ID" />
                            </DeleteParameters>
                            </asp:SqlDataSource>
                         <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
                             AutoGenerateColumns="False" CssClass="grid" DataKeyNames="ID" 
                            DataSourceID="SqlDataSource1" 
                            GridLines="None" ondatabound="GridView1_DataBound" 
                            onpageindexchanged="GridView1_PageIndexChanged" AllowSorting="True" 
                            UseAccessibleHeader="False" Width="850px" >
                            <PagerSettings Visible="False" />
                            <RowStyle CssClass="grid-row-normal" />
                            <SelectedRowStyle   CssClass="grid-row-bright" />
                            <Columns>
                             <asp:TemplateField HeaderText="操   作">
                                    <ItemTemplate>
                                        <input id="mxbu" type="button" value="明细" class="smallbutton" onclick="CB_Open_lemonhall('<%# Eval("ID") %>');"/>
                                    </ItemTemplate>
                                    <HeaderStyle HorizontalAlign="Center" />
                                    <ItemStyle HorizontalAlign="Center" CssClass="grid" Width="40px"></ItemStyle>
                                </asp:TemplateField>
                             <asp:TemplateField HeaderText="供货单位" SortExpression="名称">
                                    <EditItemTemplate>
                                        <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("名称") %>'></asp:TextBox>
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="Label4" runat="server" Text='<%# Bind("名称") %>'></asp:Label>
                                    </ItemTemplate>
                                    <HeaderStyle CssClass="grid-header" />
                                    <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="80px" />
                                </asp:TemplateField>
                                <asp:BoundField DataField="品名" HeaderText="品名" SortExpression="品名" ItemStyle-CssClass="grid"
                                            HeaderStyle-CssClass="grid-header" ItemStyle-Width="120">
                                            <HeaderStyle CssClass="grid-header"></HeaderStyle>
                                            <ItemStyle CssClass="grid" Width="120px" HorizontalAlign="Center"></ItemStyle>
                                        </asp:BoundField>

                                        <asp:BoundField DataField="钢级" HeaderText="钢级" SortExpression="钢级" ItemStyle-CssClass="grid"
                                            HeaderStyle-CssClass="grid-header" ItemStyle-Width="60">
                                            <HeaderStyle CssClass="grid-header"></HeaderStyle>
                                            <ItemStyle CssClass="grid" Width="80px" HorizontalAlign="Center"></ItemStyle>
                                        </asp:BoundField>
                                <asp:TemplateField HeaderText="名义重量合计" SortExpression="名义重量合计">
                                    <EditItemTemplate>
                                        <asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("名义重量合计") %>'></asp:TextBox>
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="Label5" runat="server" Text='<%# Bind("名义重量合计") %>'></asp:Label>
                                    </ItemTemplate>
                                    <HeaderStyle CssClass="grid-header" />
                                    <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="80px" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="实际支数合计" SortExpression="实际支数合计">
                                    <EditItemTemplate>
                                        <asp:TextBox ID="TextBox6" runat="server" Text='<%# Bind("实际支数合计") %>'></asp:TextBox>
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="Label7" runat="server" Text='<%# Bind("实际支数合计") %>'></asp:Label>
                                    </ItemTemplate>
                                    <HeaderStyle CssClass="grid-header" />
                                    <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="80px" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="车号" SortExpression="车号">
                                    <EditItemTemplate>
                                        <asp:TextBox ID="TextBox7" runat="server" Text='<%# Bind("车号") %>'></asp:TextBox>
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="Label8" runat="server" Text='<%# Bind("车号") %>'></asp:Label>
                                    </ItemTemplate>
                                    <HeaderStyle CssClass="grid-header" />
                                    <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="80px" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="质检结果" SortExpression="质检结果">
                                    <ItemTemplate>
                                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("质检结果") %>'></asp:Label>
                                    </ItemTemplate>
                                    <ControlStyle CssClass="torf" />
                                    <HeaderStyle CssClass="grid-header" />
                                    <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="80px" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="到货日期" SortExpression="到货日期">
                                    <EditItemTemplate>
                                        <asp:TextBox ID="TextBox8" runat="server" Text='<%# Bind("到货日期") %>'></asp:TextBox>
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="Label9" runat="server" Text='<%# Bind("到货日期", "{0:d}") %>'></asp:Label>
                                    </ItemTemplate>
                                    <HeaderStyle CssClass="grid-header" />
                                    <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="80px" />
                                </asp:TemplateField>

                            </Columns>
                          </asp:GridView>
		            </td>
	            </tr>
	            <tr>
		            <td>   
		                 <table width="100%">
		                    <tr>
		                        <td class="pagebar">
                                    <asp:Button ID="Button_Pager_First" runat="server" Text="" ToolTip="首页" 
                                        CssClass="pageturn-first-b" onclick="Pager_Click" CommandName="--" />
                                    <asp:Button ID="Button_Pager_Prev" runat="server" Text="" ToolTip="上一页" 
                                        CssClass="pageturn-prev-b" onclick="Pager_Click" CommandName="-" />
                                    <input type="button" class="page-split" />第<asp:TextBox ID="TextBox_Pager" runat="server" CssClass="pageturn" 
                                        ontextchanged="Pager_Click"></asp:TextBox>页<input type="button" class="page-split" /><asp:Label ID="Label_Pages" runat="server"></asp:Label><input type="button" class="page-split" />
                                    
                                    <asp:Button ID="Button_Pager_Next" runat="server" Text="" ToolTip="下一页" 
                                        CssClass="pageturn-next-b" onclick="Pager_Click" CommandName="+" />
                                    <asp:Button ID="Button_Pager_Last" runat="server" Text="" ToolTip="末页" 
                                        CssClass="pageturn-last-b" onclick="Pager_Click" CommandName="++" />
                                </td>
                                <td align="right">
                                    <asp:Label ID="Label_Total" runat="server" CssClass="grid_totalrows"></asp:Label>
                                </td>
                            </tr>
                       </table>

		            </td>
	            </tr>
            </table>
            

        </div>
    </div>
         </ContentTemplate>

    <Triggers>
     <asp:AsyncPostBackTrigger ControlID="button" EventName="Click" />
    </Triggers>         
         
    </asp:UpdatePanel>
    
<asp:Button ID="button" runat="server" OnClick="button_Click" style="display:none;"/>          
    </form>
<script type="text/javascript">
    function load() {
        //alert("Hello from Load");
        Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
        EndRequestHandler();
    }

    function EndRequestHandler() {
        //变化合格不合格函数开始
        $('.torf').each(function() {
            var status = $(this).html();
            if (status == "True") {
                $(this).html('<img src="../Images/tick-icon.png" />');
            } else {
                $(this).html('<img src="../Images/block-icon.png" />');
            }
        }); //合格不合格变化函数结束

        //截止日期默认取当天
        $('#Date1').change(function() {
            if ($('#Date2').val() == "") {
                $('#Date2').val($('#Date1').val());
            }
        });
        //清空两个日期框
        $('#clear').click(function() {
            $('#Date1').val("");
            $('#Date2').val("");
        });
        parent.hidesubmenu(true);
    }
  </script>
<script type="text/javascript">

    //打开复检判定单
    function CB_Open_lemonhall(ID) {

        CB_Gallery = new Array(); // creating the array
        CB_Gallery[0] = '原材料复检判定单'; // name of the gallery

        CB_Gallery[1] = new Array(); // array of first item:
        CB_Gallery[1][0] = '/Inspection/原料入厂验收记录.aspx?id=' + ID; // url
        CB_Gallery[1][1] = 'iframe'; // type
        CB_Gallery[1][2] = '原料入厂验收记录'; // title
        CB_Gallery[1][3] = 1440; // width
        CB_Gallery[1][4] = 600; // height
        CB_Gallery[2] = new Array(); // array of first item:
        CB_Gallery[2][0] = '/Inspection/原材料复检判定单.aspx?id=' + ID; // url
        CB_Gallery[2][1] = 'iframe'; // type
        CB_Gallery[2][2] = '原材料复检判定单'; // title
        CB_Gallery[2][3] = 1024; // width
        CB_Gallery[2][4] = 600; // height
        //alert(CB_Gallery);   //调试语句
        //给ID一个默认参数
        if (ID == null) { ID = ids[0]; }
        CB_Open('href=/Inspection/原材料复检判定单.aspx?id=' + ID + ',,gallery=原材料复检判定单,,width=1024,,height=600');
    }

    //关闭时刷新一下页面
    function CB_ExternalFunctionCBClose() {
        __doPostBack("<%= button.ClientID %>", "");
    }
					
</script> 
</body>
</html>
